import React, { Component } from 'react'
import './Home.css'
import axios from 'axios'
export default class Home extends Component {
  state = {
    inputVal: 'hello'
  }
 
  
  add = () => { 

    console.log(this);
  }
  saveInput = (e) => { 
    console.log(e.target.value);
    // this.setState({
    //   inputVal: e.target.value
    // })
    console.log('35', this.state.inputVal);
  }
  render() {
    console.log('22', this.props);
    return (
      <div>
        <div className="bg" style={{ color: 'red', fontSize: '20px' }}>Home</div>
        <div dangerouslySetInnerHTML={{
          __html: '<b>富文本编辑器<b/>'
        }}>

        </div>
        <input type="text" defaultValue={ this.state.inputVal } onInput={this.saveInput} />
        <br />
        <button onClick={ this.add }>点击</button>
     </div>
    )
  }
}
